_h_a_n_d_l_e_P_t_r A pointer to the returned handle of the compressor. Used
by subsequent calls to identify the compressor.
_h_a_n_d_l_e A handle to the compressor.
_n_u_m_b_e_r_O_f_F_r_a_m_e_s The number of frames to compress, which should be a
multiple of CL_FRAMES_PER_CHUNK (usually 1 for video).
_n_u_m_b_e_r_O_f_F_r_a_m_e_s may also be specified as
CCCCLLLL____CCCCOOOONNNNTTTTIIIINNNNUUUUOOOOUUUUSSSS____BBBBLLLLOOOOCCCCKKKK or CCCCLLLL____CCCCOOOONNNNTTTTIIIINNNNUUUUOOOOUUUUSSSS____NNNNOOOONNNNBBBBLLLLOOOOCCCCKKKK.
_f_r_a_m_e_B_u_f_f_e_r A pointer to the frame buffer to be compressed. A value of
CCCCLLLL____EEEEXXXXTTTTEEEERRRRNNNNAAAALLLL____DDDDEEEEVVVVIIIICCCCEEEE may be used with some compressors to
indicate a direct connection to an external video or audio
source. A value of NULL selects the use of a previously
created buffer to supply the frame data (Implicit
Buffering).
_c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r_S_i_z_e
A pointer to the returned size of the compressed data in
bytes.
_c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r
A pointer to where the compressed data is to be placed. A
value of NULL selects the use of a previously created
buffer to place the compressed data (Implicit Buffering).
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
ccccllllOOOOppppeeeennnnCCCCoooommmmpppprrrreeeessssssssoooorrrr opens a compressor for a given scheme. It is called
before ccccllllCCCCoooommmmpppprrrreeeessssssss or any call that requires a compressor handle.
ccccllllCCCClllloooosssseeeeCCCCoooommmmpppprrrreeeessssssssoooorrrr closes the compressor after which _h_a_n_d_l_e is no longer
valid.
ccccllllCCCCoooommmmpppprrrreeeessssssss invokes different buffering models depending on the values of
If _f_r_a_m_e_B_u_f_f_e_r and _c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r are non-NULL,
ccccllllCCCCoooommmmpppprrrreeeessssssss compresses _n_u_m_b_e_r_O_f_F_r_a_m_e_s from
_f_r_a_m_e_B_u_f_f_e_r and stores the result in _c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r
and the resulting size in _c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r_S_i_z_e.
_f_r_a_m_e_B_u_f_f_e_r may also be set to CL_EXTERNAL_DEVICE to indicate
a hardware input source (currently supported by CL_JPEG_COSMO).
2. Implicit Buffering
If _f_r_a_m_e_B_u_f_f_e_r and _c_o_m_p_r_e_s_s_e_d_B_u_f_f_e_r are NULL,
ccccllllCCCCoooommmmpppprrrreeeessssssss operates on buffers that have been created
previously with ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff. The input buffer should be
filled with calls to ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee, ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd, and
ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd. The output buffer should be emptied
with calls to ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd and ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll.
Direct and Implicit Buffering models may be mixed in one call by setting
one of the buffer arguments to be non-NULL, and the other to be NULL.
With either model, buffers should be appropriately sized for proper
execution of ccccllllCCCCoooommmmpppprrrreeeessssssss. The input frame buffer should have a minimum
capacity of CL_FRAMES_PER_CHUNK frames. The output compressed buffer
should have a minimum capacity of CL_COMPRESSED_BUFFER_SIZE bytes. These
parameters may be determined by calling ccccllllGGGGeeeettttPPPPaaaarrrraaaammmmssss, after first calling
ccccllllSSSSeeeettttPPPPaaaarrrraaaammmmssss to provide the compressor with initialization information
such as input dimensions and format.
If _n_u_m_b_e_r_O_f_F_r_a_m_e_s is non-negative, ccccllllCCCCoooommmmpppprrrreeeessssssss attempts to consume
_n_u_m_b_e_r_O_f_F_r_a_m_e_s frames of input data and may produce up to
CL_COMPRESSED_BUFFER_SIZE * _n_u_m_b_e_r_O_f_F_r_a_m_e_s / CL_FRAMES_PER_CHUNK bytes of
output data. The call does not return until processing is completed.
If _n_u_m_b_e_r_O_f_F_r_a_m_e_s is specified as CL_CONTINUOUS_BLOCK or
CL_CONTINUOUS_NONBLOCK then ccccllllCCCCoooommmmpppprrrreeeessssssss continues until either the input
buffer is marked done, or a call to ccccllllCCCClllloooosssseeeeCCCCoooommmmpppprrrreeeessssssssoooorrrr is made.
CL_CONTINUOUS_NONBLOCK differs from CL_CONTINUOUS_BLOCK in that the call
to ccccllllCCCCoooommmmpppprrrreeeessssssss returns immediately while the compression occurs in a
separate thread. These special values should only be used with Implicit
Buffering.
Multiple compressors can be open simultaneously. _h_a_n_d_l_e identifies which
one is being referenced.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
Upon success, ccccllllOOOOppppeeeennnnCCCCoooommmmpppprrrreeeessssssssoooorrrr and ccccllllCCCClllloooosssseeeeCCCCoooommmmpppprrrreeeessssssssoooorrrr return SUCCESS, and
ccccllllCCCCoooommmmpppprrrreeeessssssss returns either the numberOfFrames actually consumed or, in the
case of CL_CONTINUOUS_NONBLOCK, returns SUCCESS immediately.
Upon failure, each routine returns a negative error code. With some
schemes, ccccllllOOOOppppeeeennnnCCCCoooommmmpppprrrreeeessssssssoooorrrr returns CL_SCHEME_BUSY if there is a system
resource (e.g. a piece of hardware) which is in use by another process.